<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script type="text/javascript">
        function my_async_function(name, fn) {
            setTimeout(() => {
                fn(null, "-" + name + "-");
            }, 3000);
        }
        my_async_function("hello node.js", (err, name) => {
            if (err) {
                console.error(err);
            }
            console.log(name);
        });
    </script>
</body>

</html>